home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 575 b | 36 lines | [TEXT/CWIE] |
- // FiniteStack.h
-
- #ifndef FiniteStack_h
- #define FiniteStack_h
-
- #ifndef FiniteStackBase_h
- #include "FiniteStackBase.h"
- #endif
- #ifndef AlignedBlock_h
- #include "AlignedBlock.h"
- #endif
- #ifndef Assert_h
- #include "Assert.h"
- #endif
-
- template < class Element, uint32 size >
- class FiniteStack: public FiniteStackBase
- {
- private:
- AlignedBlock< size * sizeof( Element ) > space;
-
- public:
- FiniteStack()
- : FiniteStackBase( space, size, sizeof( Element ) )
- {}
-
- void Delete( Element *p )
- {
- Assert( p != 0 );
- p->~Element();
- Release( p );
- }
- };
-
- #endif
-